<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>教师中心</title>
    <link href="/mytaskrelease/Public/Home/css/bootstrap.min.css" rel="stylesheet">
    <link href="/mytaskrelease/Public/Home/css/app.css" rel="stylesheet">
</head>
<body >
    <div class="app-header">
        <b>在线任务发布系统</b>
    </div>
    <div class="container-fluid">
        <!--我的头部-->
        <div class="row myself-con-head text-center" >
            <div><img src="/mytaskrelease/Application/Public/Uploads/<?php if(empty($Userinfo["userpho"])): ?>me.jpg<?php else: echo ($Userinfo["userpho"]); endif; ?> " class="img-circle"></div>
            <div><?php echo ($Userinfo["nickname"]); ?></div>
        </div>
        <div class="row myself-con-tag text-center">
            <div class="col-xs-4">
                <div class="myself-con-tag1" id="mycard"><?php echo ($Userinfo["usercard"]); ?></div>
                <div class="myself-con-tag2">已连续打卡</div>
            </div>
            <div class="col-xs-4">
                <div class="myself-con-tag1"><?php echo ($Userinfo["age"]); ?></div>
                <div class="myself-con-tag2">成长日龄</div>
            </div>
            <div class="col-xs-4">
                <div class="myself-con-tag1"><?php echo ($Userinfo["billnum"]); ?></div>
                <div class="myself-con-tag2">发布任务数</div>
            </div>
        </div>
        <!--我的主体-->
        <div class="row myself-con-main">
            <div class="list-group">
                <a href="#" onclick="Punchcard()" type="button" class="list-group-item">点击打卡</a>
                <a href="/mytaskrelease/index.php/Home/Myself/modifyData" type="button" class="list-group-item">修改资料</a>
                <a href="/mytaskrelease/index.php/Home/Myself/taskList" type="button" class="list-group-item">任务列表<span class="badge">查看</span></a>
                <a href="<?php echo U('add');?>" type="button" class="list-group-item">添加任务</a>
            </div>
            <a class="btn btn-default" href="<?php echo U('Authen/logout');?>" style="width: 100%; margin-bottom: 18%;" onclick="if (confirm('确定要退出吗？')) return true; else return false;"><b>退出</b></a>
        </div>

    </div>
    <script src="/mytaskrelease/Public/Home/js/jquery.min.js"></script>
    <script src="/mytaskrelease/Public/Home/js/bootstrap.min.js"></script>
    <script src="/mytaskrelease/Public/Home/js/validate.js"></script>
    <script>
        function Punchcard() {
            $.post("/mytaskrelease/index.php/Home/Myself/punchcard",{ },function(result){
                if(result.msg=='ok'){
                    $('#mycard').text(result.usercard);
                    alert('打卡成功！');
                }else if(result.msg=='error')
                    alert('系统繁忙，请稍后！');
                else if(result.msg=='played')
                    alert('今日已打卡，明天继续努力哦！');

            });
        }
    </script>
</body>
</html>